package com.enlighten.featureExtractor.util;

import java.util.List;

public class MathUtils {

	public static double mean(List<Double> distances) {
		double sum = 0;
		for(Double value:distances)
			sum += value;
		return sum/distances.size();
	}

	public static double dsvStd(List<Double> distances) {
		double mean = mean(distances);
		double sum = 0;
		for(Double value:distances){
			double diff = value - mean;
			sum += diff * diff;
		}
		return Math.sqrt(sum/distances.size());
	}

}
